//封装与模块相关的函数

//导入工具包中的instance
import instance from '@/utils/axios.js'
//登录接口
function userLogin({mobile,code}) {
    return instance({
        url: '/v1_0/authorizations',
        method: 'post',
        data: { mobile, code }
      })
}
import { getToken } from '@/utils/token.js'
//获取用户信息
function xinxi(){
  return instance({
    url: '/v1_0/user/profile',
    method: 'get',
    // 设置请求头
    headers:{Authorization:`Bearer ${getToken().token}`}
  
  })
}
//编辑用户信息
function editxx(data) {
  return instance({
    url: '/v1_0/user/profile',
    method: 'patch',
    data,
    headers:{Authorization:`Bearer ${getToken().token}`}
  })
}
function editArte(fd) {
  return instance({
    url: '/v1_0/user/photo',
    method: 'patch',
    data:fd,
    headers:{Authorization:`Bearer ${getToken().token}`}
  })
}
//导出接口
export { userLogin,xinxi,editxx,editArte }
//导出接口